<?php
// +----------------------------------------------------------------------
// | Author: derek <693472824@qq.com> <http://www.bloveambition.com/>
// +----------------------------------------------------------------------

namespace Blovex4\Model;
use Think\Model\ViewModel;

/**
 * 小哥评价模型层
 * derek <693472824@qq.com>
 */
class EvaluationViewModel extends ViewModel {

    /**
     * 尽量减少需查询字段，以提高查询效率
     */
    protected $viewFields = array(
            
        'User'    =>  array(
                            'user_id', 'account', 'username',
        ),
            
        'WorkerEvaluation'    =>  array(
                            'ev_id', 'score', 'content', 'create_time', 'worker_id',
                            '_on'=>'User.user_id=WorkerEvaluation.user_id',
                            '_type'=>'LEFT',
        ),
            
        'Orders'    =>  array(
                            'order_no',
                            '_on'=>'WorkerEvaluation.order_id=Orders.order_id'
        ),
            
        'Worker'    =>  array(
                            'account', 'name',
                            '_on'=>'WorkerEvaluation.worker_id=Worker.worker_id'
                
        )
    );
}